import request from "@/request/request"
import qs from "qs"
// 精品推荐接口
export const JingpinAPI = () => request.get("/products/recommend")

// 热门兑换
export const ReMenAPI = () => request.get('/products/hot');

// ?验证码接口
export const sendSMSAPI = (params) => request.post("/sendSMS",qs.stringify(params))

// 手机登录接口
export const phoneReginAPI = (params) => request.post("/phoneRegin",qs.stringify(params))
// 手机绑定登录
export const BindPhoneAPI = (params) => request.post('/wechatUsers/binding',qs.stringify(params))


// 微信扫码接口
export const WeixinLoginAPI = (params) => request.post("/wechatUsers/PCLogin",qs.stringify(params))

// 获取用户接口
export const UserProfilesAPI = () => request.get("/shop/userProfiles")

// 请求详情页接口
export const GoodDetailsAPI = (id) => request.get(`/products/${id}`);

// 请求加入购物车 /shop/carts/add
export const AddToCartAPI = (params) => request.post('/shop/carts/add',qs.stringify(params))

// 商品列表渲染 
export const GoodsSearchAPI = (params) => request.get('/products',{params})
// 请求购物车数据
export const CartDataAPI = () => request.get('/shop/carts');
// 请求购物车数据
export const CartDelAPI = (pararm) => request.delete(`/shop/carts?productIds=${pararm.id}`);